import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
 
  {
    path: '/',
    name: 'Main',
    component: () => import( '../views/Main.vue'),
    children:[
      
      
      {
        path:'booktown',
        alias:'',

        name:'BookTown',
        component: () => import('../views/BookTown.vue'),
        children:[
          {
            path:'recommend',
            alias:'',
            name:'recommend',
            component: () => import('../views/Recommend.vue')
          },
          {
            path:'free',
            name:'free',
            component: () => import('../views/list/Free.vue')
          },
          {
            path:'male',
            name:'male',
            component: () => import('../views/list/Male.vue')
          },
          {
            path:'femail',
            name:'femail',
            component: () => import('../views/list/Femail')
          },
          {
            path:'publish',
            name:'publish',
            component: () => import('../views/list/Publish.vue')
          },
          {
            path:'audio',
            name:'audio',
            component: () => import('../views/list/Audio.vue')
          },
        ],
        // redirect:'recommend'
      },
      {
        path:'bookshelf',
        alias:'',
        name:'BookShelf',
        component: () => import('../views/BookShelf.vue'),
        children:[
          {
            path:'bookview',
            alias:'',

            name:'BookView',
            component: () => import('../views/BookView.vue')
          },
          {
            path:'localbookshelf',
            name:'LocalBookShelf',
            component: () => import('../views/LocalBookShelf.vue'),
            
            
          },
        ],
        redirect:'BookView'
      },
      {
        path:'classify',
        name:'Classify',
        component: () => import('../views/Classify.vue')
      },
      {
        path:'mine',
        name:'Mine',
        component: () => import('../views/Mine.vue')
      },
      
    ]
  },
  {
    path:'/search',
    name:'Search',
    component: () => import('../views/Search.vue')
  },
  {
    path:'/changeinp/:value',
    name:'changeinp',
    component: () => import('../views/ChangeInp.vue')
  },
  {
    path:'/history',
    name:'History',
    component: () => import('../views/History.vue')
  },
  {
    path:'/bookdetail/:id/:title',
    name:'BookDetail',
    component: () => import('../views/BookDetail.vue')
  },
  {
    path:'/chapter/:id',
    name:'Chapter',
    component: () => import('../views/Chapter.vue')
  },
  {
    path:'/bookcontent/:id',
    name:'BookContent',
    component: () => import('../views/BookContent.vue')
  },
  {
    path:'/login',
    name:'Login',
    component: () => import('../views/Login.vue')
  },
  {
    path:'/enroll',
    name:'Enroll',
    component: () => import('../views/Enroll.vue')
  },
  
]

const router = new VueRouter({
  routes
})

export default router
